import base64
# pip3 install pycrypto
# pip3 install pycryptodome
from Crypto.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from Crypto.PublicKey import RSA
from Crypto import Random
# 密文
private_key = r"""-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDc1g1Kf+d8dC66
Dekgo4muwc1YnoJny90ql4rjc9os+vZPbcgO73YtoPObpgukkKDGiZtRpvwY0QZ+
EfQAOIkMOJ365h2JU0FONW9AEmoESXe1vg5M5PLLTBzUlgzSyT/9/xdibOW7yW2Q
bnaq3Zn4BuUZsjM5PZf0hsu8iDDd9aC5SjOPWCvHXKtwkx8fPz/esWjo2VcaU3q7
K3p0IL7Y5u+MljXS6QT5xG0aISwPkO/mY7IKMFlkAUZgtZNVVjd8oJNOTd4XI8Jk
g51N8Z+G4iP2OmN53zijetgPXW6Bx4+ohTmTHRiijNOqTcO9w4WnSVdLo1L/x8p4
2uSkkbDLAgMBAAECggEAOJ0DYULy9DvQss/YIQ7rwApc+0f/hF6F/2JEL9VGbFuW
A3zQWcvXzxDBAvkJaRHOtbcXQ1J8tFv5vx4ZIGld8O0eyvBtSAQ47LTUJWfTF/BB
qSzk+5+CAs4rYfBpryv6pMHdm9Tw/DhCR1GaSGlxDF2wI+tEKHt61iwsVNPRO0U/
89df0k4arH7/WyuCLW+ZzSz92uUYHZ7wJKe1iY0SupjenHn5hVzt8pRSjtelznnp
+LhTzma+efRuO/MOKH/uuuPb2COfQihvUlQhaZISAg9sZURvnaDtBiIVLvoMybBI
MYOvXTmHSn1TeW/e86IQdDj9cYHey1+3XCj7jmu/2QKBgQD59ToVWkHGND8MMJgG
5eWHWOEALlxEZMklg0UMuWx0xoNWi2S2I3/a/JaLfdghSsyzJCCTRlQXlo4lBveF
8sHi8DBqqHHWA2q8BUlCB/ULxHYJQcWzxn3RlWAtnt8bhL+SwUJJIKaiW2bKLVCz
MZQBnnZXHUufq9vLHrnIQK3W1QKBgQDiLJ2VzxdD/3zThrLddH1H4KlPXDtqduZD
LwjJGk7tY5gaEtgl3z+rHcxFD6SXqj4sedHuKZ8FSPa7IjqZc7wv77MN2IA0yUs0
As65mJxMwI6IjfQ5L1OmD1obzZ6diF/NNs0sQSQ/4YHTkUOTkINCDZYxtaTfTHKn
DfAsYhJ5HwKBgQC8P1iwLhptOHnnJ03HnCqiJWjG5yNsCu+GRfeh3p/0znCppC+E
EPZAqYyDn5I/eILzw5iY8hVw8l05O6b9BVfKHxSHrzaUdFxVIDIM/csqQpqW3CcV
/r5RMouNsCHdKrvQvaW7R1DX47hlOX2WhxctpPcBIroKlbbhodFPJI8HxQKBgQCC
Yd3mQp/S3zGCbyAlccXW7bgsu6q00R4klLSn2bauOr+wKDTagDwf1Omw1je4BrgY
w5E1jmDRlyJE9pJ5a7KMn83EqY4e3/uuW//4FfXkeQyxw8OKQ7IhBLCZXouVnMw9
bN4SKOtQuBszb4ZZRvGj3lk7Bs+oulVN4EcYDuE/WQKBgQCxCQUO2KUq82R1zMJN
rBimVPicI0PDIU3mGuMLXlbU/X8Myd/x9ShyERCx9TPWnsQMrrKqu1LNe7+aUL2q
tK11Z2LQRXm8eFS4io5djqalvXMnwMw/+7RfsqmbpRWWFmSmW0ZuyQu0bzwFweAH
wF8oxEGwNfuqv0RRba70t1/UPQ==
-----END PRIVATE KEY-----"""

def getEncyptedData(encrypted):
    global private_key
    encrypted = base64.b64decode(encrypted)
    rsakey = RSA.importKey(private_key)
    cipher = Cipher_pkcs1_v1_5.new(rsakey)
    random_generator = Random.new().read
    text = cipher.decrypt(base64.b64decode(encrypted), None)
    print(text.decode('utf8'))
    return text.decode('utf8')

if __name__ == "__main__":
    encrypted = "SnVlWXBGc2FXUUNUbWtyVWNRVDhSSlpBRGF6R2pGbUFtQTBKdjlLOTg3Sk1RNHNsRW9GM1pUZ2Q2bUk2QmVYMXFIRXJVSTNOQnQ3amJJUktiTzB5SGxxYVVRNWhlb0J3cXRQVnlxVTNjUWtaVmxuR3BQeVdKaXdXM243eE5uRGpsTGNtblZPSUMxTXpuemNOMUVuTnBDK3B1cVAzSWJzUEpSYXp6NFBSS3VlZjNmTDg2TDdUR0V1cXhBc1pRK2Fra1BNSDM3Vk9KQkRRR3VyWFovbEtGRHpaUWNFRXJDSmE3TDNCUldzTnJqVlR2dnFuZkVxRVVDT0JZWWlIUVF1WmlJSEJwTzBJWEgwSGVpSWlzUWZSWDN6WmVjMWJJa2N6OWZjUFpNOGdLTnEvSkpOZnVOR0U4ZmJmS1FDODd4enMrN3JXYUs1VlI1VDk3VXN0bkY2WEtRPT0="
    getEncyptedData(encrypted)